<?php
/**
 * Created by PhpStorm.
 * User: henry
 * Date: 2017/6/6
 * Time: 下午12:03
 */

namespace common\mongo;


use Yii;
use yii\mongodb\Collection;
use yii\mongodb\Database;

class DateBase extends Database
{

    /**
     * Selects collection with given name.
     * @param string $name collection name.
     * @return Collection collection instance.
     */
    protected function selectCollection($name)
    {
        return Yii::createObject([
            'class' => '\common\mongo\Collection',
            'database' => $this,
            'name' => $name,
        ]);
    }

}